<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="header">
    <link rel="stylesheet" href="/static/iconfont/iconfont.css">
    <link rel="stylesheet" href="/static/css/message.min.css">
    <script src="/static/js/jquery-1.11.3.min.js"></script>
    <script src="/static/js/message.js"></script>
    <header>
        <div class="hwrap clearfix">
            <a href="/" class="logobox">
                <img th:src="${companyProfile.logo}" alt="" class="logo-img logo-home">
                <img th:src="${companyProfile.logoMobile}" alt="" class="logo-img logo-other">
            </a>
            <ul class="navbox" th:if="${menus != null && !menus.isEmpty()}">
                <li class="navli" th:each="m: ${menus}">
                    <a th:href="${m.id == 2 ? '/product_list' : m.href}" rel="noopener noreferrer" class="navTl">
                        <span class="cn" th:text="${session.lang == 'en' ? m.titleEn : m.title}">首页</span>
                    </a>
                    <div class="subox prosubbox" th:if="${m.children != null && !m.children.isEmpty()}">
                        <div class="indexbox">
                            <a th:href="${mc.parentId == 2 ? ('/product_list?s=' + mc.id) : mc.href}" th:each="mc: ${m.children}" th:text="${session.lang == 'en' ? mc.titleEn : mc.title}">Z系列（自动行走坡口机）</a>
                        </div>

                    </div>
                </li>
                <li class="navli lang my-lang">
                    <a href="javascript:;" lang="zh">中文版</a>
                    <a href="javascript:;" lang="en">English</a>
                </li>
                <li class="navLi code-img" style="cursor: pointer;">
                    <div class="code-img-box">
                        <img th:src="${companyProfile.weixin}" alt="">
                        <span class="header-code-text header-code-text-pc" style="margin-left:10px;">扫一扫</span>
                        <div class="priview-img animate__animated animate__fadeIn">
                            <img th:src="${companyProfile.weixin}" alt="">
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </header>
    <div class="mohead clearfix">
        <a class="logoBox" href="/" rel="noopener noreferrer"><img th:src="${companyProfile.logoMobile}"></a>
        <div class="menu">
            <span></span>
            <span></span>
            <span></span>
        </div>
    </div>
    <div class="maskout">
        <img src="/static/picture/close.png">
    </div>
    <ul class="menu_sub" th:if="${menus != null && !menus.isEmpty()}">
        <li th:each="m: ${menus}">
            <div class="subTitle bignav selected">
                <a th:href="${m.id == 2 ? '/product_list' : m.href}" rel="noopener noreferrer" th:text="${session.lang == 'en' ? m.titleEn : m.title}">首页</a>
            </div>
            <div class="subbox" th:if="${m.children != null && !m.children.isEmpty()}">
                <a th:href="${mc.parentId == 2 ? ('/product_list?s=' + mc.id) : mc.href}" th:each="mc: ${m.children}" th:text="${mc.title}">Z系列（自动行走坡口机）</a>
            </div>
        </li>

        <li class="lang-menu my-lang">
            <a href="javascript:;" lang="zh">中文版</a>
            <a href="javascript:;" lang="en">English</a>
        </li>
        <li class="code-img">
            <img src="/static/erweima.jpg" alt="">
            <span class="header-code-text">扫一扫</span>
        </li>
    </ul>
    <div class="fixed-nav">
        <div class="fixed-nav-item scroll-top">
            <i class="iconfont icon-shangyi"></i>
        </div>
    </div>
    <script>
        if (location.pathname == '/') {
            document.querySelector('.logo-home').style.display = 'block'
            document.querySelector('.logo-other').style.display = 'none'
        } else {
            document.querySelector('.logo-home').style.display = 'none'
            document.querySelector('.logo-other').style.display = 'block'
        }
        $(function(){
            $('.my-lang a').click(function(){
                var lang = $(this).attr('lang');
                $.get('/setLanguage', {"lang": lang}, function(){
                    window.location.reload();
                })
            });
        })
    </script>
</th:block>